#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2012 rambla.eu
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#      http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.import os
import platform, os, sys, datetime, time
import json
import unittest
import setup_environ
from setup_environ import *
import raws_json
from raws_json.raws_service import RawsService, Feed, Query
from raws_json.rass.service import RassService

class DirTest(unittest.TestCase):
    
    @classmethod
    def setUpClass(cls):
        cls.service = RassService(username = setup_environ.TEST_USERNAME, password = setup_environ.TEST_PASSWORD, server = setup_environ.TEST_SERVER)
        print "DirTest: starting to upload item, please wait..."
        cls.dir_entry = cls.service.createDir("test/amai03/subdir", True)
        print str(cls.dir_entry)
        # cls.item_entry = cls.service.createItem(self, dirpath, filename, local_path)
        # print "DirTest: finished uploading src"

    def setUp(self):
        """ Delete all content for the account before running each test. """
        pass
        
    def test_get_dir_feed(self):
        """ A. """
        feed = self.service.getDirList("test")
        mf = Feed(feed)
        for e in mf.entries:
            print str(e)

def suite():
   suite = unittest.TestSuite()
   suite.addTest(unittest.makeSuite(DirTest))
   return suite

if __name__=='__main__':
    unittest.main()
